<?php
/**
 * @version 0.8.3 2010-10-07
 * @package Joomla
 * @subpackage LeagueResults
 * @copyright (C)  2008, 2009, 2010 Henryk Drozd
 * @license GNU/GPL, see LICENSE.php
 * LeagueResults is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.

 * LeagueResults is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');


class lrViewTablecontent extends JView {

	function display($tpl = null)
	{
		global $mainframe;

		// Load pane behavior
		jimport('joomla.html.pane');
		JHTML::_('behavior.tooltip');

		//initialise variables
		$editor 	= & JFactory::getEditor();
		$document	= & JFactory::getDocument();
		$pane		= & JPane::getInstance('sliders');
		$user 		= & JFactory::getUser();
		$settings	= lrAdmin::config();

		//get vars
		$cid 			= JRequest::getInt( 'cid' );

		//add css and js to document
		$document->addScript('../includes/js/joomla/popup.js');
		$document->addStyleSheet('../includes/js/joomla/popup.css');

		// Get data from the model
		$model		= & $this->getModel();
		$row      	= & $this->get( 'Data');


		//create the toolbar

		JToolBarHelper::title( '<img src="components/com_lr/assets/images/lr1.jpg" height="30" width="75" alt="League Results Logo" valign="middle" /> '. JText::_( 'EDIT TABLECONTENTS' ), 'tablecontentsedit' );
		
		JToolBarHelper::apply();
		JToolBarHelper::spacer();
		JToolBarHelper::save();
		JToolBarHelper::spacer();
		JToolBarHelper::cancel();
		JToolBarHelper::spacer();
	//	JToolBarHelper::help( 'lr.editplayers', true );
	
	//here lookup ext	
		$teams = & $this->get( 'Teams');
	
		$teamlist 	= array();
		$teamlist[] 	= JHTML::_('select.option', '0', JText::_( 'SELECT TEAM' ) );
		$teamlist 	= array_merge( $teamlist, $teams );

		$theaders = & $this->get( 'Tableheaders');
	
		$thlist 	= array();
		$thlist[] 	= JHTML::_('select.option', '0', JText::_( 'SELECT TABLE' ) );
		$thlist 	= array_merge( $thlist, $theaders );
	
		$Lists = array();
		$Lists['team'] = JHTML::_('select.genericlist', $teamlist, 'team_id', 'size="1" class="inputbox"', 'value', 'text', $row->team_id );
		$Lists['tableheader'] = JHTML::_('select.genericlist', $thlist, 'tableheaders_id', 'size="1" class="inputbox"', 'value', 'text', $row->tableheaders_id );

		JHTML::_('behavior.modal', 'a.modal');

		//assign data to template
		$this->assignRef('Lists'      	, $Lists);
		$this->assignRef('row'      	, $row);
		$this->assignRef('pane'      	, $pane);
		$this->assignRef('editor'      	, $editor);
		$this->assignRef('settings'     , $settings);
		$this->assignRef('imageselect' 	, $imageselect);

		parent::display($tpl);
		
	}
}
?>